﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using websoniBO;

namespace websoni.Adminpages
{
    public partial class login : System.Web.UI.Page
    {
        Adlogin ad = new Adlogin();
        protected void Page_Load(object sender, EventArgs e)
        {
            TextBox1.Focus();
            if (!IsPostBack)
            {
                if (Request["id"] != null)
                {
                    Session.Abandon();

                    Response.Redirect("~/Adminpages/login.aspx");
                }
            }

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            DataTable dt=ad.GetRecords(-99,TextBox1.Text,TextBox2.Text,false," and ");
            if (dt.Rows.Count>0)
            {
                Session["userid"] = dt.Rows[0]["logid"].ToString();
                Response.Redirect("~/Adminpages/AHome.aspx");
            }
            else
            {
                Label3.Visible = true;
                //Response.Redirect("~/Adminpages/login.aspx");
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            TextBox1.Text = "";
            TextBox2.Text = "";
        }
    }
}
